package com.cyj.dream.core.constant;

import com.cyj.dream.core.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

/**
 * @Description: 树类型基类
 * @BelongsProject: DreamChardonnay
 * @BelongsPackage: com.cyj.dream.core.constant
 * @Author: ChenYongJia
 * @CreateTime: 2021-09-26 11:12
 * @Email: chen87647213@163.com
 * @Version: 1.0
 */
@Data
@MappedSuperclass
@EqualsAndHashCode(callSuper=false)
public class TreeEntity extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 是否展开 1:是 0：否
     */
    @Column(name="expand",columnDefinition = "VARCHAR(255) COMMENT '是否展开 1:是 0：否'")
    protected String expand;

    /**
     * 父节点id
     */
    @Column(name="parent_id",columnDefinition = "bigint(20) COMMENT '父节点id'")
    protected Long parentId;

    /**
     * 排序
     */
    @Column(name="sort", columnDefinition = "INT COMMENT '排序' default 0")
    protected Integer sort;

    /**
     * 节点路径
     */
    @Column(name="path", columnDefinition = "VARCHAR(255) COMMENT '节点路径'")
    protected String path;
}
